#include <engine.h>

GLoop::GLoop()
{
    connect( this, SIGNAL(timeout()), this, SLOT(Loop()) );
}

GLoop::~GLoop()
{
}

void GLoop::StartLoop()
{
    start();
    m_elapsedTimer.start();
}

void GLoop::StopLoop()
{
    stop();
    m_elapsedTimer.invalidate();
}

void GLoop::Loop()
{
    GEngine::GetEngine()->Tick(m_elapsedTimer.restart());
}
